<?php
include('dbconnect.php');
$cli_id = (isset($_GET['cli_id']))? $_GET['cli_id'] : $cli_id;
$con_id = (isset($_GET['con_id']))? $_GET['con_id'] : (isset($con_id))? $con_id : 0;
//$con_id = (isset($_GET['con_id']))? $_GET['con_id'] : $con_id;

$num_participant = (isset($_GET['num_participant']))? $_GET['num_participant'] : $num_participant;
?>
<?php
$sql = "SELECT con_id, con_nom FROM contacts WHERE con_cli_id='$cli_id' ORDER BY con_nom";
if ($result=$db->query($sql, False)){
	$nb = $result->num_rows;
	$retour= Array();
	for ($j = 0; $j < $nb; $j++){
		$row = $result->fetch_assoc();
		$select = ($row['con_id']==$con_id)? '1':'0';
		$retour[]=$row['con_id'].'£'.$select.'£'.$row['con_nom'];
	}
	echo implode('££', $retour);
}
$result->free();
$db->disconnect();
?>
